﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace cmsservice.Common
{
    /// <summary>
    /// 命令实体
    /// </summary>
    public class Command : ICloneable
    {
        public const string COPY = "copy";
        public const string DELETE = "delete";
        public const string RENAME = "rename";

        /// <summary>
        /// 命令编号
        /// </summary>
        public string Id
        {
            get;
            set;
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CTime
        {
            get;
            set;
        }

        /// <summary>
        /// 本地路径
        /// </summary>
        public string LocalPath
        {
            get;
            set;
        }

        /// <summary>
        /// 本地Ip
        /// </summary>
        public string ServerIp
        {
            get;
            set;
        }

        public int Port
        {
            get;
            set;
        }

        public byte[] Data
        {
            get;
            set;
        }

        /// <summary>
        /// 服务器路径
        /// </summary>
        public string ServerPath
        {
            get;
            set;
        }

        /// <summary>
        /// 总字节数
        /// </summary>
        public long Count
        {
            get;
            set;
        }

        /// <summary>
        /// 命令类型
        /// </summary>
        public string Type
        {
            get;
            set;
        }

        /// <summary>
        /// 状态 
        /// 0.未处理
        /// 1.已处理
        /// </summary>
        public int State
        {
            get;
            set;
        }

        #region ICloneable 成员

        public object Clone()
        {
            var t = new Command();
            t.Count = this.Count;
            t.CTime = this.CTime;
            t.Id = this.Id;
            t.LocalPath = this.LocalPath;
            t.ServerIp = this.ServerIp;
            t.ServerPath = this.ServerPath;
            t.Type = this.Type;
            return t;
        }

        #endregion
    }
}
